Integrand size = 23, antiderivative size = 196 \[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\frac {9 d^2 \cot (e+f x) (d \csc (e+f x))^{-2+n}}{f (1-n)}+\frac {18 d^2 \cos (e+f x) (d \csc (e+f x))^{-2+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {9 d^3 (3-2 n) \cos (e+f x) (d \csc (e+f x))^{-3+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3-n}{2},\frac {5-n}{2},\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 203, normalized size of antiderivative = 1.04, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3317, 3873, 3857, 2722, 4131} \[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\frac {a^2 d^3 (3-2 n) \cos (e+f x) (d \csc (e+f x))^{n-3} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3-n}{2},\frac {5-n}{2},\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}}+\frac {2 a^2 d^2 \cos (e+f x) (d \csc (e+f x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^2 d^2 \cot (e+f x) (d \csc (e+f x))^{n-2}}{f (1-n)} \]
[In]
[Out]
Rule 2722
Rule 3317
Rule 3857
Rule 3873
Rule 4131
Rubi steps \begin{align*} \text {integral}& = d^2 \int (d \csc (e+f x))^{-2+n} (a+a \csc (e+f x))^2 \, dx \\ & = \left (2 a^2 d\right ) \int (d \csc (e+f x))^{-1+n} \, dx+d^2 \int (d \csc (e+f x))^{-2+n} \left (a^2+a^2 \csc ^2(e+f x)\right ) \, dx \\ & = \frac {a^2 d^2 \cot (e+f x) (d \csc (e+f x))^{-2+n}}{f (1-n)}+\frac {\left (a^2 d^2 (3-2 n)\right ) \int (d \csc (e+f x))^{-2+n} \, dx}{1-n}+\left (2 a^2 d (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{1-n} \, dx \\ & = \frac {a^2 d^2 \cot (e+f x) (d \csc (e+f x))^{-2+n}}{f (1-n)}+\frac {2 a^2 \cos (e+f x) (d \csc (e+f x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right ) \sin ^2(e+f x)}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {\left (a^2 d^2 (3-2 n) (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{2-n} \, dx}{1-n} \\ & = \frac {a^2 d^2 \cot (e+f x) (d \csc (e+f x))^{-2+n}}{f (1-n)}+\frac {2 a^2 \cos (e+f x) (d \csc (e+f x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right ) \sin ^2(e+f x)}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^2 (3-2 n) \cos (e+f x) (d \csc (e+f x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3-n}{2},\frac {5-n}{2},\sin ^2(e+f x)\right ) \sin ^3(e+f x)}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}} \\ \end{align*}
Time = 4.97 (sec) , antiderivative size = 307, normalized size of antiderivative = 1.57 \[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\frac {18 (d \csc (e+f x))^n \sec ^2\left (\frac {1}{2} (e+f x)\right )^{-n} \tan \left (\frac {1}{2} (e+f x)\right ) \left (\frac {\operatorname {Hypergeometric2F1}\left (3-n,\frac {1}{2}-\frac {n}{2},\frac {3}{2}-\frac {n}{2},-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )}{1-n}+\tan \left (\frac {1}{2} (e+f x)\right ) \left (-\frac {4 \operatorname {Hypergeometric2F1}\left (3-n,1-\frac {n}{2},2-\frac {n}{2},-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )}{-2+n}+\tan \left (\frac {1}{2} (e+f x)\right ) \left (-\frac {6 \operatorname {Hypergeometric2F1}\left (\frac {3-n}{2},3-n,\frac {5-n}{2},-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )}{-3+n}-\frac {4 \operatorname {Hypergeometric2F1}\left (3-n,2-\frac {n}{2},3-\frac {n}{2},-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right ) \tan \left (\frac {1}{2} (e+f x)\right )}{-4+n}+\frac {\operatorname {Hypergeometric2F1}\left (3-n,\frac {5}{2}-\frac {n}{2},\frac {7}{2}-\frac {n}{2},-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right ) \tan ^2\left (\frac {1}{2} (e+f x)\right )}{5-n}\right )\right )\right )}{f} \]
[In]
[Out]
\[\int \left (d \csc \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right )^{2}d x\]
[In]
[Out]
\[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \]
[In]
[Out]
\[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=a^{2} \left (\int \left (d \csc {\left (e + f x \right )}\right )^{n}\, dx + \int 2 \left (d \csc {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}\, dx + \int \left (d \csc {\left (e + f x \right )}\right )^{n} \sin ^{2}{\left (e + f x \right )}\, dx\right ) \]
[In]
[Out]
\[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \]
[In]
[Out]
\[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \]
[In]
[Out]
Timed out. \[ \int (d \csc (e+f x))^n (3+3 \sin (e+f x))^2 \, dx=\int {\left (\frac {d}{\sin \left (e+f\,x\right )}\right )}^n\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^2 \,d x \]
[In]
[Out]